let currentDate = new Date();

console.log("%c超光速", " text-shadow: 0 1px 0 #ccc,0 2px 0 #c9c9c9,0 3px 0 #bbb,0 4px 0 #b9b9b9,0 5px 0 #aaa,0 6px 1px rgba(0,0,0,.1),0 0 5px rgba(0,0,0,.1),0 1px 3px rgba(0,0,0,.3),0 3px 5px rgba(0,0,0,.2),0 5px 10px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.2),0 20px 20px rgba(0,0,0,.15);font-size:5em"),
  console.log("https://www.ftls.xyz 恐咖兵糖的主页")
console.log(currentDate.toLocaleString('zh-u-ca-chinese', { dateStyle: 'full' }) + ' ' + currentDate.toLocaleTimeString(0, { hour12: false })) // 2022壬寅年九月廿九星期一 21:45:11

// 南小鸟
function nxn() {
  const nxn = document.createElement("img");
  // const imgList = ["","","2","3"];
  // nxn.src = `https://cdn.ftls.xyz/images/2023/08/nxn${imgList[Math.floor(Math.random() * 4)]}.webp`;
  nxn.src = "https://cdn.ftls.xyz/images/2023/08/nxn.webp";
  nxn.className = "nxn";
  nxn.alt = "";
  document.body.appendChild(nxn);
}

const grayDate = ["7.7", "9.18", "12.13"];
if (grayDate.includes(`${currentDate.getMonth() + 1}.${currentDate.getDate()}`)) {
  document.querySelector('html').style.filter = 'grayscale(100%)';
} else {
  nxn();
}

// 最新公告显示
function getInfo() {
  if (document.getElementById("info") != null) {
    fetch('https://note.ftls.xyz/blog/info1.md').then((response) => response.text()).then(text => {
      if (text.length <= 100 && text.startsWith('公告')) {
        document.getElementById("info").innerHTML = `<i class="fa fa-bullhorn" aria-hidden="true"></i> ${text}`;
      }
    })
  }
}

getInfo();

// 外链监测 跳转知乎

// document.body.addEventListener('click', function (e) {
//   let target = e.target.closest('.atk-comment-wrap a, .datacont a');
//   if (target && !target.href.includes('ftls.xyz')) {
//     e.preventDefault();
//     window.open('https://link.zhihu.com/?target=' + encodeURIComponent(target.href), '_blank');
//   }
// });